package com.hsbc.manager.dao;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.hsbc.entity.Permission;

public interface PermissionRepository extends JpaRepository<Permission, Integer>{

	@Query(value="select p.* from bc_permission p left join bc_role_permission rp on rp.permission_id=p.id where rp.role_id=?1",nativeQuery=true)
	List<Permission> findByRoleId(int roleId);
}
